<?php  

defined('C5_EXECUTE') or die(_("Access Denied.")); 

Loader::model('page_list'); 

class RelatedNavigationBlockController extends BlockController { 

	protected $btTable = 'btRelatedNavigation';
	protected $btInterfaceWidth = "430";
	protected $btInterfaceHeight = "300"; 
	
	public function getBlockTypeDescription() {
		return t("RelatedNavigation");
	}
	
	public function getBlockTypeName() {
		return t("RelatedNavigation");
	}
	
	public function getJavaScriptStrings() {
		return array();
	} 
	function view() {
		$this->set('externalPages', $this->getExternalPages());
	}

	function getExternalPages() {
		global $c;

		$pl = new PageList();
		$pl->sortByDisplayOrder();
		$pl->filterByParentID( $c->cID );
		$pages = $pl->get();

		$externalPages = array();
		foreach($pages as $page) {
			if ($page->isExternalLink()) {
				$externalPages[] = $page;
			}
		}
		return $externalPages;
	}

}

?>
